package cc.zy.base.hr.mapper;

import cc.zy.base.hr.entity.TrainningBatch;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 *  培训批次管理
 *  Mapper
 *
 * @author pengfeng
 * @date: 2022/3/8 17:23
 */
public interface TrainningBatchMapper extends BaseMapper<TrainningBatch> {

    /**
     * 查找培训批次详细信息
     *
     * @param page    分页对象
     * @param trainningBatch 培训批次对象，用于传递查询条件
     * @return Ipage
     */
    <T> IPage<TrainningBatch> listTrainningBatchDetailPage(Page<T> page, @Param("trainningBatch") TrainningBatch trainningBatch);

    /**
     * 查找数据库总条目数
     *
     * @param trainningBatch 培训批次对象，用于传递查询条件
     * @return Ipage
     */
    long countTrainningBatchDetail(@Param("trainningBatch") TrainningBatch trainningBatch);


    /**
     * 通过ID查找培训批次
     *
     * @return 培训批次
     */
    TrainningBatch getById(Integer trainningBatchId);

    /**
     * 查找培训批次详细信息
     *
     * @param trainningBatch 培训批次对象，用于传递查询条件
     * @return List<TrainningBatch>
     */
    List<TrainningBatch> listTrainningBatchDetail(@Param("trainningBatch") TrainningBatch trainningBatch);

    /**
     * 查询不带分页
     */
    List<TrainningBatch> listTrainningBatchListNotPage(@Param("trainningBatch") TrainningBatch trainningBatch);

    /**
     * 通过标签名查找id，判读是否重复
     *
     * @param trainningName
     * @return
     */
    Integer findId(String trainningName);
}